package com.dingwen.pro.demo02;

/**
 * 用户服务impl代理
 *
 * @author dingwen
 * @date 2021/10/06
 */
public class UserServiceImplProxy implements UserService {
    /**
     * 用户服务
     */
    private UserService userService;

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    @Override
    public void add() {
        userService.add();
        log("add");
    }

    @Override
    public void remove() {
        userService.remove();
        log("remove");
    }

    @Override
    public void findById() {
        userService.findById();
        log("findById");
    }

    @Override
    public void modify() {
        userService.modify();
        log("modify");
    }

    public void log(String msg){
        System.out.println("日志： "+ msg);
    }
}
